package com.boot.project.core.enums.code.impl.commonCode;

import com.boot.project.core.enums.code.BaseCode;
import lombok.AllArgsConstructor;

/**
 * @description: 参数相关的错误
 * @author: tsing
 * @create: 2020-08-09 14:53
 */
@AllArgsConstructor
public enum ParamCode implements BaseCode {

    // 1.参数相关(1001~1999)
    PARAM_IS_INVALID(false, 1001,"参数无效"),
    PARAM_IS_BLANK(false, 1002,"参数为空"),
    PARAM_TYPE_BIND_ERROR(false, 1003, "参数类型有误"),
    PARAM_NOT_COMPLETE(false, 1004, "参数缺失"),
    DO_NOT_EXIST_SUCH_METHOD(false, 1005, "不存在该方法"),
    PARAM_VALIDATE_FAILURE(false, 1006, "参数校验有误"),
    ;

    private Boolean success; // 是否成功
    private int code; // 状态码
    private String message; // 操作信息

    @Override
    public boolean success() {
        return this.success;
    }

    @Override
    public int code() {
        return this.code;
    }

    @Override
    public String message() {
        return this.message;
    }
}
